package nl.vu.few.ibivu.biomodels.client.presenter;

import nl.vu.few.ibivu.biomodels.client.event.MessageBroadcastEvent;
import nl.vu.few.ibivu.biomodels.client.event.MessageBroadcastType;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceController;

public abstract class AbstractPresenter implements Presenter {

	protected PlaceController placeControl;
	protected EventBus eventBus;
	
	
	
	public AbstractPresenter(EventBus eventBus, PlaceController placeControl) {
		super();
		this.placeControl = placeControl;
		this.eventBus = eventBus;
	}



	@Override
	public void goTo(Place place) {
		placeControl.goTo(place);
	}



	@Override
	public void broadcastMessage(MessageBroadcastType type, String message) {
		eventBus.fireEvent(new MessageBroadcastEvent(type, message));		
	}

}
